import { Input } from "antd"
import { ActionGroup } from ".."
import MyCard from "../../../components/core/MyCard"
import PageForm, { MyFormItemProps } from "../../../components/core/PageForm"
import useIntentModel from "../../../model/useIntentModel"

const BasicGroup = ({ title, groupkey }: ActionGroup) => {

    const { entryInfo } = useIntentModel()
    const basic = entryInfo?.basic || {}
    const customer = entryInfo?.customer || {}
    const quote = entryInfo?.quote || {}
    const { contractNo, riskResult, custManagerRate } = basic
    const { custLevel } = customer
    const { provinceAvgMonthIrr, D60MortgageRate, surplusLimit } = quote

    const children: Array<MyFormItemProps> = [
        { label: '合同编号', children: <Input disabled value={contractNo} /> },
        { label: '客户等级', children: <Input disabled value={custLevel} /> },
        { label: '风控进件要求', children: <Input disabled value={riskResult} /> },
        { label: '省份当年平均IRR', children: <Input suffix="%" disabled value={provinceAvgMonthIrr} /> },
        { label: 'D60抵押率', children: <Input disabled value={D60MortgageRate} /> },
        { label: '剩余违例额度', children: <Input disabled value={surplusLimit} /> },
        { label: '客户经理评级', children: <Input disabled value={custManagerRate} /> }
    ]
    const edit = () => {

    }
    const buttons = [{ title: '修改意向', action: edit }]

    return <MyCard groupkey={groupkey} title={title} buttons={buttons}>
        <PageForm formList={children} loopKey="BasicGroup" />
    </MyCard >


}

export default BasicGroup